TARGET = lwip
CFLAGS += -Os

BSP_BASE = ../../bsp



LWIPDIR = src

COREFILES=$(LWIPDIR)/core/init.c \
	$(LWIPDIR)/core/def.c \
	$(LWIPDIR)/core/dns.c \
	$(LWIPDIR)/core/inet_chksum.c \
	$(LWIPDIR)/core/ip.c \
	$(LWIPDIR)/core/mem.c \
	$(LWIPDIR)/core/memp.c \
	$(LWIPDIR)/core/netif.c \
	$(LWIPDIR)/core/pbuf.c \
	$(LWIPDIR)/core/raw.c \
	$(LWIPDIR)/core/stats.c \
	$(LWIPDIR)/core/sys.c \
	$(LWIPDIR)/core/tcp.c \
	$(LWIPDIR)/core/tcp_in.c \
	$(LWIPDIR)/core/tcp_out.c \
	$(LWIPDIR)/core/timeouts.c \
	$(LWIPDIR)/core/udp.c

CORE4FILES=$(LWIPDIR)/core/ipv4/autoip.c \
	$(LWIPDIR)/core/ipv4/dhcp.c \
	$(LWIPDIR)/core/ipv4/etharp.c \
	$(LWIPDIR)/core/ipv4/icmp.c \
	$(LWIPDIR)/core/ipv4/igmp.c \
	$(LWIPDIR)/core/ipv4/ip4_frag.c \
	$(LWIPDIR)/core/ipv4/ip4.c \
	$(LWIPDIR)/core/ipv4/ip4_addr.c

CORE6FILES=$(LWIPDIR)/core/ipv6/dhcp6.c \
	$(LWIPDIR)/core/ipv6/ethip6.c \
	$(LWIPDIR)/core/ipv6/icmp6.c \
	$(LWIPDIR)/core/ipv6/inet6.c \
	$(LWIPDIR)/core/ipv6/ip6.c \
	$(LWIPDIR)/core/ipv6/ip6_addr.c \
	$(LWIPDIR)/core/ipv6/ip6_frag.c \
	$(LWIPDIR)/core/ipv6/mld6.c \
	$(LWIPDIR)/core/ipv6/nd6.c

# NETIFFILES: Files implementing various generic network interface functions
NETIFFILES=$(wildcard ./src/netif/*.c)

LWIPTFTP=$(LWIPDIR)/apps/tftp/hello_lwip.c\
  		 $(LWIPDIR)/apps/tftp/tftp_server.c

C_SRCS=$(COREFILES) \
	$(CORE4FILES) \
	$(CORE6FILES) \
	$(NETIFFILES) \
	$(LWIPTFTP)

C_SRCS += $(BSP_BASE)/$(BOARD)/drivers/plic/plic_driver.c

INCLUDES += -Iinclude
INCLUDES += -I../../bsp/hbird-e200/drivers/emaclite_v4_3
INCLUDES += -I../../bsp/hbird-e200/drivers/emaclite_v4_3/include

#C_SRCS += src/api/api_lib.c
#C_SRCS += src/api/api_msg.c
#C_SRCS += src/api/err.c
#C_SRCS += src/api/netbuf.c
#C_SRCS += src/api/netdb.c
#C_SRCS += src/api/netifapi.c
#C_SRCS += src/api/sockets.c
#C_SRCS += src/core/ipv4/autoip.c
#C_SRCS += src/core/ipv4/icmp.c
#C_SRCS += src/core/ipv4/igmp.c
#C_SRCS += src/core/ipv4/inet_chksum.c
#C_SRCS += src/core/ipv4/inet.c
#C_SRCS += src/core/ipv4/ip_addr.c
#C_SRCS += src/core/ipv4/ip_frag.c
#C_SRCS += src/core/ipv4/ip.c
#C_SRCS += src/core/snmp/asn1_dec.c
#C_SRCS += src/core/snmp/asn1_enc.c
#C_SRCS += src/core/snmp/mib_structs.c
#C_SRCS += src/core/snmp/mib2.c
#C_SRCS += src/core/snmp/msg_in.c
#C_SRCS += src/core/snmp/msg_out.c
#C_SRCS += src/core/dhcp.c
#C_SRCS += src/core/dns.c
#C_SRCS += src/core/init.c
#C_SRCS += src/core/mem.c
#C_SRCS += src/core/memp.c
#C_SRCS += src/core/netif.c
#C_SRCS += src/core/pbuf.c
#C_SRCS += src/core/raw.c
#C_SRCS += src/core/stats.c
#C_SRCS += src/core/sys.c
#C_SRCS += src/core/tcp_in.c
#C_SRCS += src/core/tcp_out.c
#C_SRCS += src/core/tcp.c
#C_SRCS += src/core/udp.c
#C_SRCS += src/netif/ppp/auth.c
#C_SRCS += src/netif/ppp/chap.c
#C_SRCS += src/netif/ppp/chpms.c
#C_SRCS += src/netif/ppp/fsm.c
#C_SRCS += src/netif/ppp/ipcp.c
#C_SRCS += src/netif/ppp/lcp.c
#C_SRCS += src/netif/ppp/magic.c
#C_SRCS += src/netif/ppp/md5.c
#C_SRCS += src/netif/ppp/pap.c
#C_SRCS += src/netif/ppp/ppp_oe.c
#C_SRCS += src/netif/ppp/ppp.c
#C_SRCS += src/netif/ppp/randm.c
#C_SRCS += src/netif/ppp/vj.c
#C_SRCS += src/netif/etharp.c
#C_SRCS += src/netif/ethernetif.c
#C_SRCS += src/netif/loopif.c
#C_SRCS += src/netif/slipif.c
#C_SRCS += src/netif/xadapter.c
#C_SRCS += src/netif/xaxiemacif_dma.c
#C_SRCS += src/netif/xaximacif_fifo.c
#C_SRCS += src/netif/xaximacif_hw.c
#C_SRCS += src/netif/xaximacif_mcdma.c
#C_SRCS += src/netif/xaximacif_physpeed.c
#C_SRCS += src/netif/xemac_ieee_reg.c
#C_SRCS += src/netif/xemacliteif.c
#C_SRCS += src/netif/xemacpsif_dma.c
#C_SRCS += src/netif/xemacpsif_hw.c
#C_SRCS += src/netif/xemacpsif_physpeed.c
#C_SRCS += src/netif/xemacpsif.c
#C_SRCS += src/netif/xpqueue.c
#C_SRCS += src/netif/xtopology_g.c




include $(BSP_BASE)/$(BOARD)/env/common.mk
